<div class="container-fluid">
    <div ng-controller="dynamicModelUpdateController">
        <div class="row">
            <div class="col-sm-12">
                <form name="dynamicModelUpdateForm" class="form-horizontal" role="form" novalidate>
                    <div class="form-group">
                        <label class="col-sm-1 control-label">ID</label>
                        <div class="col-sm-3 form-control-static">{{updateRequest.id}}</div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label"><span class="text-danger">名称</span></label>
                        <div class="col-sm-3">
                            <input name="name" uib-tooltip="{{getMessage('name',dynamicModelUpdateForm.name.$error,validateMessages)}}"
                                   tooltip-trigger="none" tooltip-is-open="dynamicModelUpdateForm.name.$invalid && dynamicModelUpdateForm.name.$dirty"
                                   ng-model="updateRequest.name" type="text" class="form-control input-sm" placeholder="名称" ng-maxlength="20" required/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label"><span class="text-danger">图标</span></label>
                        <div class="col-sm-3">
                            <div class="btn-group" role="group">
                                <button type="button" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                    <span ng-if="!iconControl.selectedItem">选择图标</span>
                                    <span ng-if="iconControl.selectedItem" class="glyphicon glyphicon-{{iconControl.selectedItem}}"></span>
                                </button>
                                <ul class="dropdown-menu" style="width:611px;">
                                    <li>
                                        <div class="clearfix">
                                            <button type="button" ng-click="iconControl.select(icon);" ng-repeat="icon in iconControl.icons" class="btn btn-sm" ng-class="{'btn-default':iconControl.selectedItem != icon,'btn-primary':iconControl.selectedItem == icon}" style="margin: 2px;">
                                                <span class="glyphicon glyphicon-{{icon}}" aria-hidden="true"></span>
                                            </button>
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>
                        <div class="col-sm-2">
                            <div class="alert alert-danger" ng-show="dynamicModelUpdateForm.icon.$invalid && dynamicModelUpdateForm.icon.$dirty">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label">顶级模型</label>
                        <div class="col-sm-3">
                            <input name="isRootChild" ng-model="updateRequest.isRootChild" type="checkbox" class="input-sm" ng-true-value="true" ng-false-value="false"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label">子级模型</label>
                        <div class="col-sm-11">
                            <label class="checkbox-inline" ng-repeat="child in childrenControl.children track by $index">
                                <input type="checkbox" ng-model="child.$checked" ng-true-value="{{true}}" ng-false-value="{{false}}">{{updateRequest.id == child.id ? (updateRequest.name ? updateRequest.name : '当前模型') : child.name}}
                            </label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label">普通属性</label>
                        <div class="col-sm-11">
                            <table class="table table-condensed table-hover">
                                <caption><button type="button" class="btn btn-success btn-sm" ng-click="propertiesControl.add();">添加</button></caption>
                                <thead>
                                <tr class="active">
                                    <th width="30" rowspan="2">#</th>
                                    <th colspan="4">布局设置</th>
                                    <th colspan="6">数据设置</th>
                                    <th rowspan="2">操作</th>
                                </tr>
                                <tr class="active">
                                    <th width="75">可隐藏</th>
                                    <th width="150">分组</th>
                                    <th width="150"><span class="text-danger">标题</span></th>
                                    <th width="100"><span class="text-danger">宽度</span></th>
                                    <th width="200"><span class="text-danger">名称</span></th>
                                    <th width="125"><span class="text-danger">类型</span></th>
                                    <th width="150">默认值</th>
                                    <th width="150">可选值</th>
                                    <th width="100">级联脚本</th>
                                    <th width="100">验证规则</th>
                                </tr>
                                </thead>
                                <tbody ui-sortable="propertiesControl.sortableOptions" ng-model="updateRequest.properties">
                                <tr ng-repeat="property in updateRequest.properties" ng-init="property.__hashKey = hashKey(property)">
                                    <th>{{$index + 1}}</th>
                                    <td>
                                        <input name="canHide{{property.__hashKey}}" type="checkbox" ng-model="property.canHide"/>
                                    </td>
                                    <td>
                                        <input name="group{{property.__hashKey}}" uib-tooltip="{{getMessage('group',dynamicModelUpdateForm['group' + property.__hashKey].$error,propertyControl.validateMessages)}}"
                                               tooltip-trigger="none" tooltip-is-open="dynamicModelUpdateForm.group{{property.__hashKey}}.$invalid && dynamicModelUpdateForm.group{{property.__hashKey}}.$dirty"
                                               ng-model="property.group" type="text" class="form-control input-sm" ng-maxlength="20"/>
                                    </td>
                                    <td>
                                        <input name="label{{property.__hashKey}}" uib-tooltip="{{getMessage('label',dynamicModelUpdateForm['label' + property.__hashKey].$error,propertyControl.validateMessages)}}"
                                               tooltip-trigger="none" tooltip-is-open="dynamicModelUpdateForm.label{{property.__hashKey}}.$invalid && dynamicModelUpdateForm.label{{property.__hashKey}}.$dirty"
                                               ng-model="property.label" type="text" class="form-control input-sm" ng-maxlength="20" required/>
                                    </td>
                                    <td>
                                        <input name="viewWidth{{property.__hashKey}}" uib-tooltip="{{getMessage('viewWidth',dynamicModelUpdateForm['viewWidth' + property.__hashKey].$error,propertyControl.validateMessages)}}"
                                               tooltip-trigger="none" tooltip-is-open="dynamicModelUpdateForm.viewWidth{{property.__hashKey}}.$invalid && dynamicModelUpdateForm.viewWidth{{property.__hashKey}}.$dirty"
                                               ng-model="property.viewWidth" type="number" class="form-control input-sm" min="1" max="1000" required/>
                                    </td>
                                    <td>
                                        <input name="name{{property.__hashKey}}" uib-tooltip="{{getMessage('name',dynamicModelUpdateForm['name' + property.__hashKey].$error,propertyControl.validateMessages)}}"
                                               tooltip-trigger="none" tooltip-is-open="dynamicModelUpdateForm.name{{property.__hashKey}}.$invalid && dynamicModelUpdateForm.name{{property.__hashKey}}.$dirty"
                                               ng-model="property.name" type="text" class="form-control input-sm" ng-pattern="/^[a-zA-Z_]\w{0,31}$/" required/>
                                    </td>
                                    <td>
                                        <select name="type{{property.__hashKey}}" uib-tooltip="{{getMessage('type',dynamicModelUpdateForm['type' + property.__hashKey].$error,propertyControl.validateMessages)}}"
                                                tooltip-trigger="none" tooltip-is-open="dynamicModelUpdateForm.type{{property.__hashKey}}.$invalid && dynamicModelUpdateForm.type{{property.__hashKey}}.$dirty"
                                                ng-change="propertyControl.changeType(property)" ng-model="property.type" ng-options="option.type as option.name for option in propertyControl.typeOptions"
                                                class="form-control input-sm" required>
                                            <option value="">--选择--</option>
                                        </select>
                                    </td>
                                    <td ng-switch="property.type">
                                        <select ng-switch-when="Boolean" ng-model="property.defaultValue" ng-options="option for option in [true,false]" class="form-control input-sm">
                                            <option value="">--选择--</option>
                                        </select>
                                        <input ng-switch-when="Long" ng-model="property.defaultValue" type="number" class="form-control input-sm"/>
                                        <input ng-switch-when="Double" ng-model="property.defaultValue" type="number" class="form-control input-sm"/>
                                        <input ng-switch-when="String" ng-model="property.defaultValue" type="text" class="form-control input-sm"/>
                                        <input ng-switch-when="Date" ng-model="property.defaultValue" readonly="readonly" type="text" class="form-control input-sm" uib-datepicker-popup="yyyy-MM-dd" is-open="opened" ng-click="opened = !opened" close-text="关闭" current-text="今天"  clear-text="清除"/>
                                        <select ng-switch-when="Enum" ng-model="property.defaultValue" ng-options="option for option in property.optionalValues" class="form-control input-sm">
                                            <option value="">--选择--</option>
                                        </select>
                                        <input ng-switch-when="Model" ng-model="property.defaultValue" disabled="disabled" type="text" class="form-control input-sm"/>
                                    </td>
                                    <td>
                                        <div class="input-group" ng-if="'Enum'==property.type">
                                            <input type="text" class="form-control input-sm" ng-model="property.optionalValue" ng-keyup="propertyControl.addOptionalValue(property, $event)">
                                            <div class="input-group-btn">
                                                <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="caret"></span></button>
                                                <ul class="dropdown-menu dropdown-menu-right">
                                                    <li ng-repeat="optionalValue in property.optionalValues track by $index">
                                                        <a href="javascript:void(0)">{{optionalValue}}&nbsp;&nbsp;<i class="glyphicon glyphicon-remove" ng-click="propertyControl.removeOptionalValue(property, $index)"></i></a>
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="btn-group">
                                            <button type="button" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">编写脚本 <span class="caret"></span></button>
                                            <ul class="dropdown-menu" style="width:500px;">
                                                <li>
                                                    <textarea style="width: 480px;margin-left: 10px; height:500px;" ng-model="property.cascadeScript" placeholder="内置变量$property"
                                                              ng-change="resetScript(property)" uib-tooltip="脚本有语法错误" tooltip-trigger="none" tooltip-is-open="property.hasScriptError"></textarea>
                                                </li>
                                            </ul>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="btn-group">
                                            <button type="button" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">设置规则 <span class="caret"></span></button>
                                            <ul class="dropdown-menu" style="width:250px;">
                                                <li>
                                                    <a href="javascript:void(0)">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">必输</span>&nbsp;
                                                            <input type="checkbox" ng-model="property.validator.required"/>
                                                        </div>
                                                    </a>
                                                </li>
                                                <li ng-if="propertyControl.validatorRules[property.type].min">
                                                    <a href="javascript:void(0)">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">最小</span>
                                                            <input ng-model="property.validator.min" type="number" class="form-control input-sm"/>
                                                        </div>
                                                    </a>
                                                </li>
                                                <li ng-if="propertyControl.validatorRules[property.type].max">
                                                    <a href="javascript:void(0)">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">最大</span>
                                                            <input ng-model="property.validator.max" type="number" class="form-control input-sm"/>
                                                        </div>
                                                    </a>
                                                </li>
                                                <li ng-if="propertyControl.validatorRules[property.type].minlength">
                                                    <a href="javascript:void(0)">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">最短</span>
                                                            <input ng-model="property.validator.minlength" type="number" class="form-control input-sm"/>
                                                        </div>
                                                    </a>
                                                </li>
                                                <li ng-if="propertyControl.validatorRules[property.type].maxlength">
                                                    <a href="javascript:void(0)">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">最长</span>
                                                            <input ng-model="property.validator.maxlength" type="number" class="form-control input-sm"/>
                                                        </div>
                                                    </a>
                                                </li>
                                                <li ng-if="propertyControl.validatorRules[property.type].pattern">
                                                    <a href="javascript:void(0)">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">正则</span>
                                                            <input ng-model="property.validator.pattern" type="text" class="form-control input-sm"/>
                                                        </div>
                                                    </a>
                                                </li>
                                                <li ng-if="propertyControl.validatorRules[property.type].pattern">
                                                    <a href="javascript:void(0)">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">提示</span>
                                                            <input ng-model="property.validator.patternTooltip" type="text" class="form-control input-sm"/>
                                                        </div>
                                                    </a>
                                                </li>
                                            </ul>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="btn-group">
                                            <button type="button" class="btn btn-danger btn-sm" ng-click="propertiesControl.delete(property, $index)"><span class="glyphicon glyphicon-remove"></span></button>
                                        </div>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label">联合属性</label>
                        <div class="col-sm-11">
                            <table class="table table-condensed table-hover">
                                <caption><button type="button" class="btn btn-success btn-sm" ng-click="associationControl.add();">添加</button></caption>
                                <thead>
                                <tr class="active">
                                    <th width="30" rowspan="2">#</th>
                                    <th colspan="4">布局设置</th>
                                    <th colspan="6">数据设置</th>
                                    <th rowspan="2">操作</th>
                                </tr>
                                <tr class="active">
                                    <th width="75">可隐藏</th>
                                    <th width="150">分组</th>
                                    <th width="150"><span class="text-danger">标题</span></th>
                                    <th width="100"><span class="text-danger">宽度</span></th>
                                    <th width="200"><span class="text-danger">名称</span></th>
                                    <th width="125"><span class="text-danger">类型</span></th>
                                    <th width="150">默认值</th>
                                    <th width="150">可选值</th>
                                    <th width="100">级联脚本</th>
                                    <th width="100">验证规则</th>
                                </tr>
                                </thead>
                                <tbody ui-sortable="associationControl.sortableOptions" ng-model="updateRequest.association">
                                <tr ng-repeat="property in updateRequest.association" ng-init="property.__hashKey = hashKey(property)">
                                    <th>{{$index + 1}}</th>
                                    <td>
                                        <input name="canHide{{property.__hashKey}}" type="checkbox" ng-model="property.canHide" ng-change="resetHead()"/>
                                    </td>
                                    <td>
                                        <input name="group{{property.__hashKey}}" uib-tooltip="{{getMessage('group',dynamicModelUpdateForm['group' + property.__hashKey].$error,propertyControl.validateMessages)}}"
                                               tooltip-trigger="none" tooltip-is-open="dynamicModelUpdateForm.group{{property.__hashKey}}.$invalid && dynamicModelUpdateForm.group{{property.__hashKey}}.$dirty"
                                               ng-model="property.group" type="text" class="form-control input-sm" ng-maxlength="20" ng-change="resetHead()"/>
                                    </td>
                                    <td>
                                        <input name="label{{property.__hashKey}}" uib-tooltip="{{getMessage('label',dynamicModelUpdateForm['label' + property.__hashKey].$error,propertyControl.validateMessages)}}"
                                               tooltip-trigger="none" tooltip-is-open="dynamicModelUpdateForm.label{{property.__hashKey}}.$invalid && dynamicModelUpdateForm.label{{property.__hashKey}}.$dirty"
                                               ng-model="property.label" type="text" class="form-control input-sm" ng-maxlength="20" required/>
                                    </td>
                                    <td>
                                        <input name="viewWidth{{property.__hashKey}}" uib-tooltip="{{getMessage('viewWidth',dynamicModelUpdateForm['viewWidth' + property.__hashKey].$error,propertyControl.validateMessages)}}"
                                               tooltip-trigger="none" tooltip-is-open="dynamicModelUpdateForm.viewWidth{{property.__hashKey}}.$invalid && dynamicModelUpdateForm.viewWidth{{property.__hashKey}}.$dirty"
                                               ng-model="property.viewWidth" type="number" class="form-control input-sm" min="1" max="1000" required/>
                                    </td>
                                    <td>
                                        <input name="name{{property.__hashKey}}" uib-tooltip="{{getMessage('name',dynamicModelUpdateForm['name' + property.__hashKey].$error,propertyControl.validateMessages)}}"
                                               tooltip-trigger="none" tooltip-is-open="dynamicModelUpdateForm.name{{property.__hashKey}}.$invalid && dynamicModelUpdateForm.name{{property.__hashKey}}.$dirty"
                                               ng-model="property.name" type="text" class="form-control input-sm" ng-pattern="/^[a-zA-Z_]\w{0,31}$/" required/>
                                    </td>
                                    <td>
                                        <select name="type{{property.__hashKey}}" uib-tooltip="{{getMessage('type',dynamicModelUpdateForm['type' + property.__hashKey].$error,propertyControl.validateMessages)}}"
                                                tooltip-trigger="none" tooltip-is-open="dynamicModelUpdateForm.type{{property.__hashKey}}.$invalid && dynamicModelUpdateForm.type{{property.__hashKey}}.$dirty"
                                                ng-change="propertyControl.changeType(property)" ng-model="property.type" ng-options="option.type as option.name for option in propertyControl.typeOptions"
                                                class="form-control input-sm" required>
                                            <option value="">--选择--</option>
                                        </select>
                                    </td>
                                    <td ng-switch="property.type">
                                        <select ng-switch-when="Boolean" ng-model="property.defaultValue" ng-options="option for option in [true,false]" class="form-control input-sm">
                                            <option value="">--选择--</option>
                                        </select>
                                        <input ng-switch-when="Long" ng-model="property.defaultValue" type="number" class="form-control input-sm"/>
                                        <input ng-switch-when="Double" ng-model="property.defaultValue" type="number" class="form-control input-sm"/>
                                        <input ng-switch-when="String" ng-model="property.defaultValue" type="text" class="form-control input-sm"/>
                                        <input ng-switch-when="Date" ng-model="property.defaultValue" readonly="readonly" type="text" class="form-control input-sm" uib-datepicker-popup="yyyy-MM-dd" is-open="opened" ng-click="opened = !opened" close-text="关闭" current-text="今天"  clear-text="清除"/>
                                        <select ng-switch-when="Enum" ng-model="property.defaultValue" ng-options="option for option in property.optionalValues" class="form-control input-sm">
                                            <option value="">--选择--</option>
                                        </select>
                                        <input ng-switch-when="Model" ng-model="property.defaultValue" disabled="disabled" type="text" class="form-control input-sm"/>
                                    </td>
                                    <td>
                                        <div class="input-group" ng-if="'Enum'==property.type">
                                            <input type="text" class="form-control input-sm" ng-model="property.optionalValue" ng-keyup="propertyControl.addOptionalValue(property, $event)">
                                            <div class="input-group-btn">
                                                <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="caret"></span></button>
                                                <ul class="dropdown-menu dropdown-menu-right">
                                                    <li ng-repeat="optionalValue in property.optionalValues track by $index">
                                                        <a href="javascript:void(0)">{{optionalValue}}&nbsp;&nbsp;<i class="glyphicon glyphicon-remove" ng-click="propertyControl.removeOptionalValue(property, $index)"></i></a>
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="btn-group">
                                            <button type="button" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">编写脚本 <span class="caret"></span></button>
                                            <ul class="dropdown-menu" style="width:500px;">
                                                <li>
                                                    <textarea style="width: 480px;margin-left: 10px; height:500px;" ng-model="property.cascadeScript" placeholder="内置变量$property"
                                                              ng-change="resetScript(property)" uib-tooltip="脚本有语法错误" tooltip-trigger="none" tooltip-is-open="property.hasScriptError"></textarea>
                                                </li>
                                            </ul>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="btn-group">
                                            <button type="button" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">设置规则 <span class="caret"></span></button>
                                            <ul class="dropdown-menu" style="width:250px;">
                                                <li>
                                                    <a href="javascript:void(0)">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">必输</span>&nbsp;
                                                            <input type="checkbox" ng-model="property.validator.required" ng-change="resetMessage(property)"/>
                                                        </div>
                                                    </a>
                                                </li>
                                                <li ng-if="propertyControl.validatorRules[property.type].min">
                                                    <a href="javascript:void(0)">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">最小</span>
                                                            <input ng-model="property.validator.min" type="number" class="form-control input-sm" ng-change="resetMessage(property)"/>
                                                        </div>
                                                    </a>
                                                </li>
                                                <li ng-if="propertyControl.validatorRules[property.type].max">
                                                    <a href="javascript:void(0)">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">最大</span>
                                                            <input ng-model="property.validator.max" type="number" class="form-control input-sm" ng-change="resetMessage(property)"/>
                                                        </div>
                                                    </a>
                                                </li>
                                                <li ng-if="propertyControl.validatorRules[property.type].minlength">
                                                    <a href="javascript:void(0)">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">最短</span>
                                                            <input ng-model="property.validator.minlength" type="number" class="form-control input-sm" ng-change="resetMessage(property)"/>
                                                        </div>
                                                    </a>
                                                </li>
                                                <li ng-if="propertyControl.validatorRules[property.type].maxlength">
                                                    <a href="javascript:void(0)">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">最长</span>
                                                            <input ng-model="property.validator.maxlength" type="number" class="form-control input-sm" ng-change="resetMessage(property)"/>
                                                        </div>
                                                    </a>
                                                </li>
                                                <li ng-if="propertyControl.validatorRules[property.type].pattern">
                                                    <a href="javascript:void(0)">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">正则</span>
                                                            <input ng-model="property.validator.pattern" type="text" class="form-control input-sm" ng-change="resetMessage(property)"/>
                                                        </div>
                                                    </a>
                                                </li>
                                                <li ng-if="propertyControl.validatorRules[property.type].pattern">
                                                    <a href="javascript:void(0)">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">提示</span>
                                                            <input ng-model="property.validator.patternTooltip" type="text" class="form-control input-sm" ng-change="resetMessage(property)"/>
                                                        </div>
                                                    </a>
                                                </li>
                                            </ul>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="btn-group">
                                            <button type="button" class="btn btn-danger btn-sm" ng-click="associationControl.delete(property, $index)"><span class="glyphicon glyphicon-remove"></span></button>
                                        </div>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label">快捷预设</label>
                        <div class="col-sm-11">
                            <table class="table table-condensed table-hover">
                                <caption>
                                    <button type="button" class="btn btn-success btn-sm" ng-click="predefinedAssociationControl.add();">添加</button>
                                    <div class="btn-group">
                                        <button type="button" class="btn btn-info btn-sm" ng-if="predefinedAssociationControl.hasHideCols" ng-click="predefinedAssociationControl.showOrHideCols();">{{predefinedAssociationControl.hideCols  ? "显示" : "隐藏"}}列</button>
                                        <button type="button" class="btn btn-info btn-sm dropdown-toggle" ng-if="predefinedAssociationControl.hasHideCols" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                            <span class="caret"></span>
                                        </button>
                                        <ul class="dropdown-menu dropdown-menu-right">
                                            <li ng-repeat="property in updateRequest.association | filter:{canHide:true}">
                                                <a href="javascript:void(0);"><input type="checkbox" ng-click="property.$hide=!property.$hide;resetHead(true)" ng-checked="!property.$hide"/> {{property.group ? property.group : ""}} {{property.group ? "-" : ""}} {{property.label}}</a>
                                            </li>
                                        </ul>
                                    </div>
                                </caption>
                                <thead>
                                <tr class="active" ng-if="predefinedAssociationControl.tableHead.heads.length">
                                    <th width="30" rowspan="2">#</th>
                                    <th ng-show="!property.$hide" width="{{property.span ? '' : property.viewWidth}}" ng-repeat="property in predefinedAssociationControl.tableHead.groupHeads"
                                        rowspan="{{property.span ? '' : 2}}" colspan="{{!property.span ? '' : property.span}}">
                                        <span ng-class="{'text-danger': property.validator.required, 'hide-col':property.canHide}">{{property.span ? property.group : property.label}}</span>
                                    </th>
                                    <th rowspan="2" style="min-width: 45px;">操作</th>
                                </tr>
                                <tr class="active" ng-if="predefinedAssociationControl.tableHead.heads.length">
                                    <th ng-show="!property.$hide" width="{{property.viewWidth}}" ng-repeat="property in predefinedAssociationControl.tableHead.heads">
                                        <span ng-class="{'text-danger': property.validator.required, 'hide-col':property.canHide}">{{property.label}}</span>
                                    </th>
                                </tr>
                                <tr class="active" ng-if="!predefinedAssociationControl.tableHead.heads.length">
                                    <th width="30">#</th>
                                    <th ng-show="!property.$hide" width="{{property.viewWidth}}" ng-repeat="property in updateRequest.association">
                                        <span ng-class="{'text-danger': property.validator.required, 'hide-col':property.canHide}">{{property.label}}</span>
                                    </th>
                                    <th style="min-width: 45px;">操作</th>
                                </tr>
                                </thead>
                                <tbody ui-sortable="predefinedAssociationControl.sortableOptions" ng-model="updateRequest.predefinedAssociation">
                                <tr ng-repeat="propertyValue in updateRequest.predefinedAssociation">
                                    <th>{{$index + 1}}</th>
                                    <td ng-show="!property.$hide" ng-repeat="property in updateRequest.association" ng-switch="property.type" ng-init="propertyValue.__hashKey = hashKey(propertyValue)">
                                        <input name="$association${{property.name + propertyValue.__hashKey}}" uib-tooltip="{{getMessage(property.name,dynamicModelUpdateForm['$association$' + property.name + propertyValue.__hashKey].$error,associationMessages)}}"
                                               tooltip-trigger="none" tooltip-is-open="dynamicModelUpdateForm.$association${{property.name + propertyValue.__hashKey}}.$invalid && dynamicModelUpdateForm.$association${{property.name + propertyValue.__hashKey}}.$dirty"
                                               ng-switch-when="Boolean" ng-model="propertyValue[property.name]" type="checkbox" ng-true-value="true" ng-false-value="false" ng-change="property.cascadeFunction(propertyValue)"/>
                                        <input name="$association${{property.name + propertyValue.__hashKey}}" uib-tooltip="{{getMessage(property.name,dynamicModelUpdateForm['$association$' + property.name + propertyValue.__hashKey].$error,associationMessages)}}"
                                               tooltip-trigger="none" tooltip-is-open="dynamicModelUpdateForm.$association${{property.name + propertyValue.__hashKey}}.$invalid && dynamicModelUpdateForm.$association${{property.name + propertyValue.__hashKey}}.$dirty"
                                               ng-switch-when="Long" ng-model="propertyValue[property.name]" type="number" class="form-control input-sm" ng-change="property.cascadeFunction(propertyValue)"
                                               min="{{property.validator.min}}" max="{{property.validator.max}}" ng-minlength="property.validator.minlength" ng-maxlength="property.validator.maxlength" ng-pattern="property.validator.pattern" ng-required="property.validator.required"/>
                                        <input name="$association${{property.name + propertyValue.__hashKey}}" uib-tooltip="{{getMessage(property.name,dynamicModelUpdateForm['$association$' + property.name + propertyValue.__hashKey].$error,associationMessages)}}"
                                               tooltip-trigger="none" tooltip-is-open="dynamicModelUpdateForm.$association${{property.name + propertyValue.__hashKey}}.$invalid && dynamicModelUpdateForm.$association${{property.name + propertyValue.__hashKey}}.$dirty"
                                               ng-switch-when="Double" ng-model="propertyValue[property.name]" type="number" class="form-control input-sm" ng-change="property.cascadeFunction(propertyValue)"
                                               min="{{property.validator.min}}" max="{{property.validator.max}}" ng-minlength="property.validator.minlength" ng-maxlength="property.validator.maxlength" ng-pattern="property.validator.pattern" ng-required="property.validator.required"/>
                                        <input name="$association${{property.name + propertyValue.__hashKey}}" uib-tooltip="{{getMessage(property.name,dynamicModelUpdateForm['$association$' + property.name + propertyValue.__hashKey].$error,associationMessages)}}"
                                               tooltip-trigger="none" tooltip-is-open="dynamicModelUpdateForm.$association${{property.name + propertyValue.__hashKey}}.$invalid && dynamicModelUpdateForm.$association${{property.name + propertyValue.__hashKey}}.$dirty"
                                               ng-switch-when="String" ng-model="propertyValue[property.name]" type="text" class="form-control input-sm" ng-change="property.cascadeFunction(propertyValue)"
                                               ng-minlength="property.validator.minlength" ng-maxlength="property.validator.maxlength" ng-pattern="property.validator.pattern" ng-required="property.validator.required"/>
                                        <input name="$association${{property.name + propertyValue.__hashKey}}" uib-tooltip="{{getMessage(property.name,dynamicModelUpdateForm['$association$' + property.name + propertyValue.__hashKey].$error,associationMessages)}}"
                                               tooltip-trigger="none" tooltip-is-open="dynamicModelUpdateForm.$association${{property.name + propertyValue.__hashKey}}.$invalid && dynamicModelUpdateForm.$association${{property.name + propertyValue.__hashKey}}.$dirty"
                                               ng-switch-when="Date" ng-model="propertyValue[property.name]" type="text" readonly="readonly" class="form-control input-sm" ng-change="property.cascadeFunction(propertyValue)"
                                               uib-datepicker-popup="yyyy-MM-dd" is-open="opened" ng-click="opened = !opened" close-text="关闭" current-text="今天"  clear-text="清除"
                                               ng-required="property.validator.required"/>
                                        <select name="$association${{property.name + propertyValue.__hashKey}}" uib-tooltip="{{getMessage(property.name,dynamicModelUpdateForm['$association$' + property.name + propertyValue.__hashKey].$error,associationMessages)}}"
                                                tooltip-trigger="none" tooltip-is-open="dynamicModelUpdateForm.$association${{property.name + propertyValue.__hashKey}}.$invalid && dynamicModelUpdateForm.$association${{property.name + propertyValue.__hashKey}}.$dirty"
                                                ng-switch-when="Enum" ng-model="propertyValue[property.name]" ng-options="option for option in property.optionalValues" class="form-control input-sm" ng-change="property.cascadeFunction(propertyValue)"
                                                ng-required="property.validator.required">
                                            <option value="">--选择--</option>
                                        </select>
                                        <input name="$association${{property.name + propertyValue.__hashKey}}" uib-tooltip="{{getMessage(property.name,dynamicModelUpdateForm['$association$' + property.name + propertyValue.__hashKey].$error,associationMessages)}}"
                                               tooltip-trigger="none" tooltip-is-open="dynamicModelUpdateForm.$association${{property.name + propertyValue.__hashKey}}.$invalid && dynamicModelUpdateForm.$association${{property.name + propertyValue.__hashKey}}.$dirty"
                                               ng-switch-when="Model" ng-model="propertyValue[property.name].name" readonly="readonly" type="text" class="form-control input-sm" ng-change="property.cascadeFunction(propertyValue)"
                                               ng-click="dataModelPickerModalOpen(dataModel,propertyValue,property.name,property.label,dynamicModelUpdateForm['$association$' + property.name + propertyValue.__hashKey]);"
                                               ng-required="property.validator.required"/>
                                    </td>
                                    <td>
                                        <div class="btn-group">
                                            <button type="button" class="btn btn-danger btn-sm" ng-click="predefinedAssociationControl.delete(propertyValue, $index)"><span class="glyphicon glyphicon-remove"></span></button>
                                        </div>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-3 col-sm-offset-5">
                            <button type="button" class="btn btn-warning btn-sm" location-back>取消</button>
                            <button type="button" ng-disabled="dynamicModelUpdateForm.$invalid || dynamicModelUpdateForm.$pristine || iconControl.$error" class="btn btn-primary btn-sm" ng-click="update()">保存</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
